/*
 * @(#)ModelEvent.java 0.5 08/12/04
 *
 * Copyright 2008 100town.com. All rights reserved.
 * Use is subject to license terms.
 */
package org.collada.util.action;

import java.awt.event.ActionEvent;

import org.collada.model.Action;

public class ModelEvent extends ActionEvent{
	/*
     * JDK 1.1 serialVersionUID 
     */
    private static final long serialVersionUID = -7671778796273832149L;
    
    Action modelAction;
	public Action getModelAction() {
		return modelAction;
	}

	public void setModelAction(Action modelAction) {
		this.modelAction = modelAction;
	}
	/**
     * Constructs an <code>ModelEvent</code> object.
     * <p>
     * Note that passing in an invalid <code>id</code> results in
     * unspecified behavior. This method throws an
     * <code>IllegalArgumentException</code> if <code>source</code>
     * is <code>null</code>.
     * A <code>null</code> <code>command</code> string is legal,
     * but not recommended.
     *
     * @param source  the object that originated the event
     * @param id      an integer that identifies the event
     * @param command a string that may specify a command (possibly one 
     *                of several) associated with the event
     * @throws IllegalArgumentException if <code>source</code> is null
     */
    public ModelEvent(Action amodelAction, Object source, int id, String command) {
        super(source, id, command, 0);
        modelAction = amodelAction;
    }

    /**
     * Constructs an <code>ActionEvent</code> object with modifier keys.
     * <p>
     * Note that passing in an invalid <code>id</code> results in
     * unspecified behavior. This method throws an
     * <code>IllegalArgumentException</code> if <code>source</code>
     * is <code>null</code>.
     * A <code>null</code> <code>command</code> string is legal,
     * but not recommended.
     *
     * @param source    the object that originated the event
     * @param id        an integer that identifies the event
     * @param command   a string that may specify a command (possibly one 
     *                  of several) associated with the event
     * @param modifiers the modifier keys held down during this action
     * @throws IllegalArgumentException if <code>source</code> is null
     */
    public ModelEvent(Action amodelAction, Object source, int id, String command, int modifiers) {
        super(source, id, command, 0, modifiers);
        modelAction = amodelAction;
    }

    /**
     * Constructs an <code>ActionEvent</code> object with the specified
     * modifier keys and timestamp.
     * <p>
     * Note that passing in an invalid <code>id</code> results in
     * unspecified behavior. This method throws an
     * <code>IllegalArgumentException</code> if <code>source</code>
     * is <code>null</code>.
     * A <code>null</code> <code>command</code> string is legal,
     * but not recommended.
     *
     * @param source    the object that originated the event
     * @param id        an integer that identifies the event
     * @param command   a string that may specify a command (possibly one 
     *                  of several) associated with the event
     * @param when      the time the event occurred
     * @param modifiers the modifier keys held down during this action
     * @throws IllegalArgumentException if <code>source</code> is null
     *
     * @since 1.0
     */
    public ModelEvent(Action amodelAction, Object source, int id, String command, long when,
                       int modifiers){
        super(source, id, command, when, modifiers);
        modelAction = amodelAction;
    }

}
